Support node16+ moduleResolution in ESM directories through named exports#1894
Support node16+ moduleResolution in ESM directories through named exports#1894Septh wants to merge 1 commit intorollup:masterfrom
moduleResolution in ESM directories through named exports#1894Conversation
|
Appreciate the additional effort here, but we need a different direction so we're not dealing with bandaids. Node 20.19.0 released proper compatibility for importing/requiring EMS from CJS. Now that Node 18 is out of LTS, we can safely enforce Node 20.19.0 as the minimum version. That means there's no reason for this repo to ship support for both CJS and ESM anymore. What the project needs is for every plugin to be authored in TS and updated to ship only ESM. That should nuke any TS compat issues as well as bring the repo up to date. (For what it's worth, this is also something that needs to happen on a per-package basis, not a single PR that updates the world at once) |
|
Well, I tried 😅 Agreed, this is the way to go. Any ETA about this? Do you need any help? |
|
@Septh I'll try and tackle this at some point this week. I'm planning on going one plugin at a time. If you'd like to begin that process, please feel free. I do want to avoid a large PR with many plugins affected at once. |
|
Sorry for the late reply, I've been quite busy these last days.
Yes, I am willing to contribute! Maybe we should synchronize so we don't both work on the same plugins. Any suggestions as to which packages I could start with? |
Rollup Plugin Name:
{name}This PR contains:
Are tests included?
Breaking Changes?
If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers:
Fixes #1541, #1578
Supersedes #1744, #1782
Description
Since #1782 is still failing in CI and since I still have no idea how to fix it, this new PR is a shameful attempt to work around the issue by providing named exports for all plugins, in addition to the default export.
I've also added a note in each README.md, right below the usage example, that reads like this:
Note
If your editor complains that "XXX is not a function", then use the named export instead:
Because there is absolutely no code change except for an additional export of the main factory function, I don't think new tests are necessary here. Please let me know if you feel otherwise.